package com.yuyou.hxyy.service.api.mapper;

import com.yuyou.hxyy.service.api.bean.Pagination;
import com.yuyou.hxyy.service.api.entity.Word;
import com.yuyou.hxyy.service.api.vo.resp.WordVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface WordMapper {
    int deleteByPrimaryKey(Long wordId);

    int insert(Word record);

    Word selectByPrimaryKey(Long wordId);

    int updateByPrimaryKeySelective(Word record);

    Integer getMaxSort(@Param(value = "unitId") Long unitId);

    Word findByRepoUnitEn(@Param(value = "repoId") Long repoId , @Param(value = "unitId") Long unitId , @Param(value = "en") String en);

    void deleteByIds(@Param(value = "ids") String ids);

    void deleteByRepoIds(@Param(value = "repoIds") String repoIds);

    void deleteByUnitIds(@Param(value = "unitIds") String unitIds);

    int findWordCount(Pagination<WordVo> queryPgn);

    List<WordVo> findWordPage(Pagination<WordVo> queryPgn);

    int batchInsertWord(List<Word> wordList);

    Integer findWordCountByRepo(@Param(value = "wordRepoId") Long wordRepoId);

    Integer findLearnedWordCountByRepo(@Param(value = "wordRepoId") Long wordRepoId , @Param(value = "userId") Long userId);

    void updateByEn(@Param(value = "en") String en);

    List<Word> findAllWordByStatus();
}